import numpy as np

def convert(src, des):
    data = np.load(src)
    temp = []
    for item in data:
        temp.append([item.real, item.imag])
    temp = np.array(temp) # 512*2*40000
    temp = np.transpose(temp, (2,1,0)) # 40000*2*512
    np.save(des, temp)
    print(f"{des} is saved")

convert('./h_down.npy', './down_2dim.npy')
convert('./h_up.npy', './up_2dim.npy')